Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Flake8 for nemo.export module #11728

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

janekl
Copy link
Collaborator

@janekl janekl commented Dec 31, 2024

What does this PR do ?

Run & apply Flake8 suggestions for nemo.export including (most common):

Collection: NLP / LLM

Usage

Flake8 command to diagnose issues (skipping selected ones):

flake8 nemo/export/ --ignore E203,W503,E501 --per-file-ignores="__init__.py:F401"

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

@janekl janekl requested a review from ko3n1g January 13, 2025 15:23
Copy link
Contributor

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.export.multimodal.build
nemo/export/multimodal/build.py:39:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:73:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:89:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:115:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:214:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:241:4: C0115: Missing class docstring (missing-class-docstring)
nemo/export/multimodal/build.py:242:8: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:250:8: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:263:4: C0115: Missing class docstring (missing-class-docstring)
nemo/export/multimodal/build.py:270:8: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:359:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:377:4: C0115: Missing class docstring (missing-class-docstring)
nemo/export/multimodal/build.py:384:8: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:436:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:469:4: C0115: Missing class docstring (missing-class-docstring)
nemo/export/multimodal/build.py:477:8: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:506:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/multimodal/build.py:521:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.sentencepiece_tokenizer
nemo/export/sentencepiece_tokenizer.py:236:0: C0301: Line too long (137/119) (line-too-long)
nemo/export/sentencepiece_tokenizer.py:55:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:84:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:113:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:119:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:138:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:144:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:153:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:161:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:186:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:194:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:202:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:210:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:217:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:224:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:231:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:243:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:253:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:256:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:263:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/sentencepiece_tokenizer.py:266:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.trt_llm.converter.model_converter
nemo/export/trt_llm/converter/model_converter.py:35:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_converter.py:48:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_converter.py:108:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.trt_llm.converter.model_to_trt_llm_ckpt
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:55:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:61:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:69:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:86:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:101:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:111:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:115:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:130:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:291:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:298:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:305:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:506:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.trt_llm.nemo_ckpt_loader.nemo_file
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:51:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:162:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:192:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:203:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:207:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:232:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:243:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:264:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:359:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:477:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:564:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:568:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:579:0: C0115: Missing class docstring (missing-class-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:591:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:631:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:668:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:681:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:25:0: W0611: Unused import tensorstore (unused-import)
************* Module nemo.export.trt_llm.tensorrt_llm_build
nemo/export/trt_llm/tensorrt_llm_build.py:31:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.trt_llm.tensorrt_llm_run
nemo/export/trt_llm/tensorrt_llm_run.py:501:0: C0301: Line too long (124/119) (line-too-long)
nemo/export/trt_llm/tensorrt_llm_run.py:505:0: C0301: Line too long (135/119) (line-too-long)
nemo/export/trt_llm/tensorrt_llm_run.py:509:0: C0301: Line too long (123/119) (line-too-long)
nemo/export/trt_llm/tensorrt_llm_run.py:552:0: C0301: Line too long (181/119) (line-too-long)
nemo/export/trt_llm/tensorrt_llm_run.py:836:0: C0301: Line too long (153/119) (line-too-long)
nemo/export/trt_llm/tensorrt_llm_run.py:519:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/tensorrt_llm_run.py:528:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/tensorrt_llm_run.py:586:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.utils.lora_converter
nemo/export/utils/lora_converter.py:29:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/utils/lora_converter.py:43:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/utils/lora_converter.py:51:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/utils/lora_converter.py:160:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.vllm.model_converters
nemo/export/vllm/model_converters.py:59:0: C0115: Missing class docstring (missing-class-docstring)
nemo/export/vllm/model_converters.py:122:0: C0115: Missing class docstring (missing-class-docstring)
nemo/export/vllm/model_converters.py:191:0: C0115: Missing class docstring (missing-class-docstring)
nemo/export/vllm/model_converters.py:268:0: C0115: Missing class docstring (missing-class-docstring)
************* Module nemo.export.vllm_exporter
nemo/export/vllm_exporter.py:38:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/vllm_exporter.py:429:4: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.68/10

Mitigation guide:

  • Add sensible and useful docstrings to functions and methods
  • For trivial methods like getter/setters, consider adding # pylint: disable=C0116 inside the function itself
  • To disable multiple functions/methods at once, put a # pylint: disable=C0116 before the first and a # pylint: enable=C0116 after the last.

By applying these rules, we reduce the occurance of this message in future.

Thank you for improving NeMo's documentation!

Copy link
Contributor

[🤖]: Hi @janekl 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants